const { defineConfig } = require("@vue/cli-service");
const path = require("path");

function resolve(dir) {
  return path.join(__dirname, dir);
}

module.exports = defineConfig({
  transpileDependencies: true,
  publicPath: "/",
  outputDir: "dist",
  assetsDir: "static",
  lintOnSave: process.env.NODE_ENV === "development",
  productionSourceMap: false,
  devServer: {
    open: true,
    proxy: {},
  },
  configureWebpack: {
    // provide the app's title in webpack's name field, so that
    // it can be accessed in index.html to inject the correct title.
    name: "isualization-template",
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },
    performance: {
      maxEntrypointSize: 400000,
      maxAssetSize: 250000,
    },
  },
  css: {
    loaderOptions: {
      //全局配置utils.scss,详细配置参考vue-cli官网
      scss: {
        additionalData: '@import "@/styles/util.scss";',
      },
      less: {
        javascriptEnabled: true,
      },
    },
  },
});
